﻿using ApiDAL.Common;
using ApiModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ApiModel;
using System.Data.SqlClient;
using System.Data;
using DataAccess.SqlClient;
using System.Text;

namespace ApiDAL
{
    public class Teacherdal
    {
        /// <summary>
        /// 教师登录
        /// </summary>
        /// <param name="teaname"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        public int TeacherLogin(string teaname,string password)
        {
            SqlQuery SQL = new SqlQuery();
            SQL.CommandText = "TeacherstratorLogin";
            SQL.CommandType = CommandType.StoredProcedure;
            SqlParameter sp1 = new SqlParameter();
            sp1.Value = teaname;
            sp1.ParameterName = "@teaname";
            SQL.Parameters.Add(sp1);
            SqlParameter sp2 = new SqlParameter();
            sp2.Value = password;
            sp2.ParameterName = "@password";
            SQL.Parameters.Add(sp2);
            int i = Convert.ToInt32(SqlDataAccess.ExecScalar(SQL));
            return i;
        }
            



    }
}
